from flask import Flask
import argparse

app = Flask("apps_zjh_web_easy_demo")


@app.route("/")
def index():
    return "hello world"


def main():
    parser = argparse.ArgumentParser(
        description='APPS Flask Web Demo.'
    )
    parser.add_argument('-l', '--host', default="")
    parser.add_argument('-p', '--port', default=-1)

    args = parser.parse_args()
    host = args.host
    port = int(args.port)
    app.run(host=host if host else None,
            port=port if port != -1 else None)


if __name__ == "__main__":
    main()
